package cn.gson.springboot.model.pjos;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "offer_contractinfo", schema = "springboot", catalog = "")
public class OfferContractinfo {
    private int ocId;
    private Integer ocState;
    private Offer offerByOfferId2;
    private Contract contractByContractId;

    @Id
    @Column(name = "oc_id")
    public int getOcId() {
        return ocId;
    }

    public void setOcId(int ocId) {
        this.ocId = ocId;
    }

    @Basic
    @Column(name = "oc_state")
    public Integer getOcState() {
        return ocState;
    }

    public void setOcState(Integer ocState) {
        this.ocState = ocState;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OfferContractinfo that = (OfferContractinfo) o;
        return ocId == that.ocId &&
                Objects.equals(ocState, that.ocState);
    }

    @Override
    public int hashCode() {
        return Objects.hash(ocId, ocState);
    }

    @ManyToOne
    @JoinColumn(name = "offer_id2", referencedColumnName = "offer_id2")
    public Offer getOfferByOfferId2() {
        return offerByOfferId2;
    }

    public void setOfferByOfferId2(Offer offerByOfferId2) {
        this.offerByOfferId2 = offerByOfferId2;
    }

    @ManyToOne
    @JoinColumn(name = "contract_id", referencedColumnName = "contract_id")
    public Contract getContractByContractId() {
        return contractByContractId;
    }

    public void setContractByContractId(Contract contractByContractId) {
        this.contractByContractId = contractByContractId;
    }
}
